<?php ob_start() ?>

<div class="row">
    <?php if (isset($_SESSION['publicidad_msj'])) { ?>
        <div class="alert alert-success alert-dismissable col-lg-12 text-center">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <strong><?php echo $_SESSION['publicidad_msj'] ?></strong>
        </div>
        <?php
        unset($_SESSION['publicidad_msj']);
    }
    ?>
    <div class="col-lg-12">
        <h1>Clientes <small>Datos Perfil</small></h1>
    </div>
</div>
<hr>    
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-primary" id="panel">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-archive"></i> Datos del Cliente</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-striped table-hover">
                        <tbody>
                            <tr>
                                <th>Nombre</th>
                                <td><?php echo $obj_cliente->nombre ?></td>
                            </tr>
                            <tr>
                            <tr>
                                <th>Apellidos</th>
                                <td><?php echo $obj_cliente->apellidos ?></td>
                            </tr>
                            <tr>
                                <th>Dirección</th>
                                <td><?php echo $obj_cliente->direccion ?></td>
                            </tr>
                            <tr>
                            <tr>
                                <th>Localidad</th>
                                <td><?php echo $obj_cliente->localidad ?></td>
                            </tr>
                            <tr>
                            <tr>
                                <th>Provincia</th>
                                <td><?php echo $obj_cliente->provincia ?></td>
                            </tr>
                            <tr>
                            <tr>
                                <th>País</th>
                                <td><?php echo $obj_cliente->pais ?></td>
                            </tr>
                            <tr>
                                <th>Teléfono</th>
                                <td><?php echo $obj_cliente->telefono ?></td>
                            </tr>
                            <tr>
                                <th>Email</th>
                                <td><?php echo $obj_cliente->email ?></td>
                            </tr>
                            <tr>
                                <th>Documento identidad</th>
                                <td><?php echo $obj_cliente->documento_identidad ?></td>
                            </tr>
                            <tr>
                                <th>Cuenta bancaria</th>
                                <td><?php echo $obj_cliente->cuenta_bancaria ?></td>
                            </tr>
                            <tr>
                                <th>Activo</th>
                                <?php
                                if ($obj_cliente->activo == 0) {
                                    echo '<td>No</td>';
                                } else {
                                    echo '<td>Sí</td>';
                                }
                                ?>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <hr>
        <!--<a class="btn btn-primary" href="modificar_perfil/<?php echo $obj_cliente->getId(); ?>"><i class="fa fa-edit"></i> Modificar Perfil</a>-->
        <!-- Button trigger modal -->
        <button class="btn btn-primary" data-toggle="modal" data-target="#modalPassword">Cambiar Contraseña</button>

        <!-- Modal -->
        <div class="modal fade" id="modalPassword" tabindex="-1" role="dialog" aria-labelledby="modalPassword" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <form class="form-horizontal" role="form" action="cambiar_clave_cliente" method="POST">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel">Cambio de Contraseña</h4>
                        </div>
                        <div class="modal-body">

                            <div class="form-group">
                                <label for=password" class="col-sm-4 control-label">Contraseña</label>
                                <div class="col-sm-8">
                                    <input type="password" class="form-control" id="password" name="password" placeholder="Contraseña" required="requerided">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for=confirm_password" class="col-sm-4 control-label">Confirmar Contraseña</label>
                                <div class="col-sm-8">
                                    <input type="password" class="form-control" id="confirm_password" name="confirm_password" placeholder="Confirmar Contraseña" required="requerided">
                                </div>
                            </div>

                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                            <input type="submit" class="btn btn-primary" value="Guardar Cambios" id="modalbutton">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <?php
    $contenido = ob_get_clean();
    include "app/templates/$template.php";
    ?>
